<!DOCTYPE html>
<html lang="en">

<head>
    <#include "/pages/admin_include/head.html"/>
</head>

<body data-type="widgets">
<script src="pages/admin/assets/js/theme.js"></script>
<div class="am-g tpl-g">
    <!-- 头部 -->
    <#include "/pages/admin_include/header.html"/>
    <!-- 风格切换 -->
    <#include "/pages/admin_include/theme.html"/>
    <!-- 侧边导航栏 -->
    <#include "/pages/admin_include/menu.html"/>
    <!-- 内容区域 -->
    <div class="tpl-content-wrapper">
        <div class="row-content am-cf">
            <div class="row">
                <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
                    <div class="widget am-cf">
                        <div class="widget-head am-cf">
                            <div class="widget-title  am-cf">图片列表</div>
                        </div>
                        <div class="widget-body  am-fr">
                            <div class="am-u-sm-12 am-u-md-6 am-u-lg-6">
                                <div class="am-form-group">
                                    <div class="am-btn-toolbar">
                                        <div class="am-btn-group am-btn-group-xs">
                                            <a type="button" class="am-btn am-btn-default am-btn-success" href="${basePath!}/admin/picture/goSave">
                                                <span class="am-icon-plus"></span> 新增
                                            </a>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <form action="${basePath!}/admin/picture" method="post">
                            <div class="am-u-sm-12 am-u-md-6 am-u-lg-3">
                                <div class="am-form-group tpl-table-list-select">
                                    <select name="columnId" data-am-selected="{btnSize: 'sm'}">
                                        <option value="0">所有栏目</option>
                                        <#if columns??>
                                            <#list columns as column>
                                                <option value="${column.id}" <#if (currentColumnId!0)==column.id>selected</#if>>${column.name}</option>
                                            </#list>
                                        </#if>
                                    </select>
                                </div>
                            </div>
                            <div class="am-u-sm-12 am-u-md-12 am-u-lg-3">
                                <div class="am-input-group am-input-group-sm tpl-form-border-form cl-p">
                                    <span class="am-input-group-btn">
                                            <button class="am-btn  am-btn-default am-btn-success tpl-table-list-field am-icon-search" type="submit"></button>
                                    </span>
                                </div>
                            </div>
                            </form>
                            <div class="am-u-sm-12">
                                <table width="100%" class="am-table am-table-compact am-table-bordered am-table-radius am-table-striped tpl-table-black " id="example-r">
                                    <thead>
                                    <tr>
                                        <th>ID</th>
                                        <th>图片名称</th>
                                        <th>内容</th>
                                        <th>所属栏目</th>
                                        <th>图片预览</th>
                                        <th>顺序</th>
                                        <th>创建时间</th>
                                        <th>操作</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <#list pictures.list as picture>
                                        <tr class="<#if (picture_index+1)%2==1>gradeX<#else>even gradeC</#if>">
                                            <td class="am-text-middle">${picture.id!}</td>
                                            <td class="am-text-middle">${picture.name!}</td>
                                            <td class="am-text-middle">
                                                <#if (picture.summary)?? && ((picture.summary?length)>10)>
                                                    ${picture.summary?substring(0,10)}......
                                                <#else>
                                                    ${(picture.summary)!"无摘要"}
                                                </#if>
                                            </td>
                                            <td class="am-text-middle">
                                                <#if columns?? && (picture.columnId)??>
                                                    <#list columns as column>
                                                        <#if (column.id)==(picture.columnId)>
                                                            ${column.name}
                                                            <#break>
                                                        </#if>
                                                    </#list>
                                                <#else>
                                                    无
                                                </#if>
                                            </td>
                                            <td>
                                                <#if (picture.filePath)??>
                                                    <img src="${basePath!}/img?fileName=${picture.filePath}" class="tpl-table-line-img" width="100px" height="65px" alt="">
                                                <#else>
                                                    <img src="pages/admin/assets/img/none.jpg" class="tpl-table-line-img" width="100px" height="65px" alt="">
                                                </#if>
                                            </td>
                                            <td class="am-text-middle">
                                                ${picture.orderNo!}
                                            </td>
                                            <td class="am-text-middle">${picture.createDate!}</td>
                                            <td class="am-text-middle">
                                                <div class="tpl-table-black-operation">
                                                    <a href="admin/picture/goSave?id=${picture.id!}&pageNumber=${pictures.pageNumber!}&pageSize=${pictures.pageSize!}">
                                                        <i class="am-icon-pencil"></i> 编辑
                                                    </a>
                                                    <a href="admin/picture/del?id=${picture.id!}&pageNumber=${pictures.pageNumber!}&pageSize=${pictures.pageSize!}" class="tpl-table-black-operation-del">
                                                        <i class="am-icon-trash"></i> 删除
                                                    </a>
                                                    <a href="admin/picture/goImgForm?id=${picture.id!}&pageNumber=${pictures.pageNumber!}&pageSize=${pictures.pageSize!}">
                                                        <i class="am-icon-pencil"></i> 添加图片
                                                    </a>
                                                </div>
                                            </td>
                                        </tr>
                                    </#list>
                                    <!-- more data -->
                                    </tbody>
                                </table>
                            </div>
                            <!-- 导航条 -->
                            <div class="am-u-lg-12 am-cf">
                                <div class="am-fr">
                                    <ul data-am-widget="pagination" class="am-pagination am-pagination-default">
                                        <#if (pictures.pageNumber>1)>
                                        <li class="am-pagination-first ">
                                            <a href="javascript:location.href='admin/picture?pageNumber=1&pageSize=${(pictures.pageSize)!15}&columnId=${currentColumnId!0}'" class="">第一页</a>
                                        <#else>
                                         <li class="am-pagination-first am-disabled">
                                            <a href="javascript:void(0);" >第一页</a>
                                        </#if>
                                        </li>

                                            <#if (pictures.pageNumber>1)>
                                                <li class="am-pagination-prev ">
                                                <a href="javascript:location.href='admin/picture?pageNumber=${(pictures.pageNumber)-1}&pageSize=${(pictures.pageSize)!15}&columnId=${currentColumnId!0}'" class="">上一页</a>
                                                <#else>
                                                <li class="am-pagination-prev am-disabled">
                                                    <a href="javascript:void(0);">上一页</a>
                                            </#if>
                                        </li>
                                            <#if (pictures.pageNumber<pictures.totalPage)>
                                        <li class="am-pagination-next ">
                                            <a href="javascript:location.href='admin/picture?pageNumber=${(pictures.pageNumber)+1}&pageSize=${(pictures.pageSize)!15}&columnId=${currentColumnId!0}'" class="">下一页</a>
                                            <#else>
                                        <li class="am-pagination-next am-disabled">
                                                <a href="javascript:void(0);" class="">下一页</a>
                                                </#if>
                                        </li>

                                            <#if (pictures.pageNumber < pictures.totalPage)>
                                        <li class="am-pagination-last ">
                                            <a href="javascript:location.href='admin/picture?pageNumber=${pictures.totalPage}&pageSize=${(pictures.pageSize)!15}&columnId=${currentColumnId!0}'" class="">最末页</a>
                                            <#else>
                                        <li class="am-pagination-last am-disabled">
                                                <a href="javascript:void(0);" class="">最末页</a>
                                                </#if>
                                        </li>
                                    </ul>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- footer_js -->
<#include "/pages/admin_include/footer_js.html"/>
</body>

</html>